home *** CD-ROM | disk | FTP | other *** search
- package netscape.ldap.controls;
-
- import java.io.ByteArrayInputStream;
- import netscape.ldap.LDAPControl;
- import netscape.ldap.ber.stream.BERConstruct;
- import netscape.ldap.ber.stream.BERElement;
- import netscape.ldap.ber.stream.BEREnumerated;
- import netscape.ldap.ber.stream.BERInteger;
- import netscape.ldap.ber.stream.BERIntegral;
- import netscape.ldap.ber.stream.BERSequence;
- import netscape.ldap.client.JDAPBERTagDecoder;
-
- public class LDAPVirtualListResponse extends LDAPControl {
- public static final String VIRTUALLISTRESPONSE = "2.16.840.1.113730.3.4.10";
- private int m_firstPosition;
- private int m_contentCount;
- private int m_resultCode = -1;
-
- LDAPVirtualListResponse() {
- super("2.16.840.1.113730.3.4.10", true, (byte[])null);
- }
-
- public LDAPVirtualListResponse(byte[] var1) {
- super("2.16.840.1.113730.3.4.10", true, (byte[])null);
- super.m_value = var1;
- this.parseResponse();
- }
-
- public int getContentCount() {
- return this.m_contentCount;
- }
-
- public int getFirstPosition() {
- return this.m_firstPosition;
- }
-
- public int getResultCode() {
- return this.m_resultCode;
- }
-
- private void parseResponse() {
- ByteArrayInputStream var1 = new ByteArrayInputStream(((LDAPControl)this).getValue());
- new BERSequence();
- JDAPBERTagDecoder var2 = new JDAPBERTagDecoder();
- int[] var3 = new int[]{0};
-
- try {
- BERSequence var4 = (BERSequence)BERElement.getElement(var2, var1, var3);
- this.m_firstPosition = ((BERInteger)((BERConstruct)var4).elementAt(0)).getValue();
- this.m_contentCount = ((BERInteger)((BERConstruct)var4).elementAt(1)).getValue();
- BEREnumerated var5 = (BEREnumerated)((BERConstruct)var4).elementAt(2);
- this.m_resultCode = ((BERIntegral)var5).getValue();
- } catch (Throwable var6) {
- this.m_firstPosition = this.m_contentCount = this.m_resultCode = -1;
- }
- }
-
- public static LDAPVirtualListResponse parseResponse(LDAPControl[] var0) {
- LDAPVirtualListResponse var1 = null;
-
- for(int var2 = 0; var0 != null && var2 < var0.length; ++var2) {
- if (var0[var2].getID().equals("2.16.840.1.113730.3.4.10")) {
- var1 = new LDAPVirtualListResponse(var0[var2].getValue());
- var1.parseResponse();
- break;
- }
- }
-
- if (var1 != null) {
- var1.parseResponse();
- }
-
- return var1;
- }
- }
-